﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class Property_Info_Property_Details : System.Web.UI.Page
{
    private int propertyId;
    protected void Page_Load(object sender, EventArgs e)
    {
        Master.CurrentPage = Pages.Details;

        propertyId = Master.PropertyID;
        SetPropertyDetails();
    }

    private void SetPropertyDetails()
    {
        Property_Data pd = new Property_Data();
        DataSet dsSearchResults = pd.GetDetails(propertyId);

        lblSquareFootage.Text = dsSearchResults.Tables[0].Rows[0]["sq_footage"].ToString();
        lblBR.Text = dsSearchResults.Tables[0].Rows[0]["bedrooms"].ToString() + " Bed";
        lblBA.Text = dsSearchResults.Tables[0].Rows[0]["baths"].ToString() + " Full  " + dsSearchResults.Tables[0].Rows[0]["half_baths"].ToString() + " Half";
        lblYearBuilt.Text = dsSearchResults.Tables[0].Rows[0]["year_built"].ToString();
        lblSchoolDistrict.Text = dsSearchResults.Tables[0].Rows[0]["school_desc"].ToString();
        lblParcelID.Text = dsSearchResults.Tables[0].Rows[0]["parcel_id"].ToString();
        lblTaxValue.Text = String.Format("{0:C}",Double.Parse(dsSearchResults.Tables[0].Rows[0]["taxable_total_val"].ToString()));
        lblTaxes.Text = String.Format("{0:C}",Double.Parse(dsSearchResults.Tables[0].Rows[0]["annual_taxes"].ToString()));
        lblLastTransfer.Text = String.Format("{0:C}",Double.Parse(dsSearchResults.Tables[0].Rows[0]["last_sale_price"].ToString()));

        lblZestimate.Text = "$234,900";
        lblNumForeclosures.Text = "4";
        lblNumComps.Text = "6";
        lblNumListings.Text = "29";

        lblPriceForeclosures.Text = "$9,700 - $78,900";
        lblPriceComps.Text = "$110,000 - $268,900";
        lblPriceListings.Text = "$224,400 - $299,900";
    }
}
